/*
 * @Author: 矫建武 1452239416@qq.com
 * @Date: 2024-09-04 17:13:38
 * @LastEditTime: 2024-10-14 15:02:09
 * @FilePath: \games\tool\src\router\index.ts
 * @Description:
 *
 * @file: https://github.com/OBKoro1/koro1FileHeader/wiki/%E5%AE%89%E8%A3%85%E5%92%8C%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B
 */
/**
 * 集成element-plus  icon图标库 参考  https://element-plus.gitee.io/zh-CN/component/icon.html
 * 集成iconpark      icon图标库 参考  https://iconpark.oceanengine.com/official (引入后需要手动修改为大驼峰大驼峰)
 */
import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../views/Login.vue'

const modules = import.meta.glob('./modules/*.ts', { eager: true })
const arr = Object.values(modules).map((item: any) => item.default)
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      isHide: true,
      component: Login
    },
    //区分环境是web还是electron
    ...arr.filter((ele) => {
      return !ele.isHide
    })
  ]
})

export default router
